home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
cdev
/
sludge.sit
/
Source Code
/
Parasite.c
< prev
next >
Wrap
Text File
|
1999-10-07
|
10KB
|
196 lines
/*ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
Ñ Ñ
Ñ File Name: Ñ
Ñ ---------- Ñ
Ñ Ñ
Ñ Copyright ⌐ 1990 Apple Computer, Inc. All Rights Reserved Ñ
Ñ Ñ
Ñ Description Ñ
Ñ ----------- Ñ
Ñ This file contains the c language portion of the parasite. The Ñ
Ñ parasite is what slows down your mac. Ñ
Ñ Ñ
Ñ History Ñ
Ñ ------- Ñ
Ñ Ñ
Ñ Author Date Description Ñ
Ñ ------------------------------------------------------------------ Ñ
Ñ Kevin McEntee 2/20/90 Original Implementation Ñ
Ñ Ñ
Ñ Ñ
ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ*/
#include <Types.h>
#pragma segment NUGG
/*ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
Ñ Ñ
Ñ Structure showing the jump-trace Ñ
Ñ exception stack frame. Ñ
Ñ Ñ
ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ*/
typedef struct {
short status_register;
Ptr program_counter;
short vector_offset;
char byte0;
char byte1;
char byte2;
char byte3;
char byte4;
char byte5;
char byte6;
char byte7;
char byte8;
char byte9;
char byte10;
char byte11;
char byte12;
char byte13;
char byte14;
char byte15;
} a_trap_stack_frame;
/*ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
Ñ Ñ
Ñ Comment Block. Ñ
Ñ Ñ
ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ*/
Ptr get_a_trap_exception_vector();
void save_system_a_trap_vector(Ptr vector);
void TAKE_A_TRAP_EXCEPTION_VECTOR();
Ptr get_a_trap_stack_frame_program_counter(a_trap_stack_frame *frame);
Ptr GET_SAVED_A_TRAP_VECTOR();
Handle GET_MASTER_A_TRAP_HANDLE();
void SET_JUMP_TRACE_BIT();
void TAKE_JUMP_TRACE_VECTOR(long sludge_factor);
/*ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
Ñ Ñ
Ñ Identifier: start_sludging Ñ
Ñ ----------- Ñ
Ñ Ñ
Ñ Description Ñ
Ñ ----------- Ñ
Ñ This function starts the sludging. It sets the jump-trace and Ñ
Ñ a-trap exceptions to SLUDGE routines and sets the jump-trace bit Ñ
Ñ in the status register. Ñ
Ñ Ñ
Ñ History Ñ
Ñ ------- Ñ
Ñ Ñ
Ñ Author Date Description Ñ
Ñ ------------------------------------------------------------------ Ñ
Ñ Kevin McEntee 2/20/90 Original Implementation Ñ
Ñ Ñ
Ñ Ñ
ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ*/
void start_sludging(long sludge_factor)
{
save_system_a_trap_vector( get_a_trap_exception_vector() );
TAKE_JUMP_TRACE_VECTOR(sludge_factor);
TAKE_A_TRAP_EXCEPTION_VECTOR();
SET_JUMP_TRACE_BIT();
}
/*ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
Ñ Ñ
Ñ Identifier: get_a_trap_exception_vector Ñ
Ñ ----------- Ñ
Ñ Ñ
Ñ Description Ñ
Ñ ----------- Ñ
Ñ This function returns the current a-trap exception vector. Ñ
Ñ Ñ
Ñ History Ñ
Ñ ------- Ñ
Ñ Ñ
Ñ Author Date Description Ñ
Ñ ------------------------------------------------------------------ Ñ
Ñ Kevin McEntee 2/20/90 Original Implementation Ñ
Ñ Ñ
Ñ Ñ
ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ*/
Ptr get_a_trap_exception_vector()
{
Handle vector;
vector = (Handle) 0x28;
return( *vector);
}
/*ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
Ñ Ñ
Ñ Identifier: HLL_ATRAP_EX Ñ
Ñ ----------- Ñ
Ñ Ñ
Ñ Description Ñ
Ñ ----------- Ñ
Ñ HLL_ATRAP_EX stands for: High Level Language A-Trap Execution. Ñ
Ñ This function is called by SLUDGE's atrap exception handler and Ñ
Ñ returns the system value for the A-Trap exception handler, so the Ñ
Ñ system can process the trap. Ñ
Ñ Ñ
Ñ History Ñ
Ñ ------- Ñ
Ñ Ñ
Ñ Author Date Description Ñ
Ñ ------------------------------------------------------------------ Ñ
Ñ Kevin McEntee 2/20/90 Original Implementation Ñ
Ñ Ñ
Ñ Ñ
ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ*/
Ptr HLL_ATRAP_EX(Handle register_A0, a_trap_stack_frame *frame)
{
return(GET_SAVED_A_TRAP_VECTOR());
}
/*ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
Ñ Ñ
Ñ Identifier: save_system_a_trap_vector Ñ
Ñ ----------- Ñ
Ñ Ñ
Ñ Description Ñ
Ñ ----------- Ñ
Ñ This function saves the system a-trap exception vector so we can Ñ
Ñ jump to it during a-trap processing. Ñ
Ñ Ñ
Ñ History Ñ
Ñ ------- Ñ
Ñ Ñ
Ñ Author Date Description Ñ
Ñ ------------------------------------------------------------------ Ñ
Ñ Kevin McEntee 2/20/90 Original Implementation Ñ
Ñ Ñ
Ñ Ñ
ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ*/
void save_system_a_trap_vector(Ptr vector)
{
Handle master_handle;
master_handle = GET_MASTER_A_TRAP_HANDLE();
*master_handle = vector;
}